﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json.Linq;
using TaobalLibrary.Requests;

namespace TaobaoLibrary.Demo
{
    class Program
    {
        static void Main(string[] args)
        {
            Shop shop = Shop.GetShop("tanaka");// 
            Product product = shop.GetProducts()[4];

            List<Review> lst = product.GetReviews().ToList();

            if (lst != null)
                for (int ii = 0; ii < lst.Count; ii++)
                    Console.WriteLine(lst[ii].User.Id + ":" + lst[ii].User.Name);

            //JToken jobj = JsonpParser.ParseJsonpToObject("jsonp_reviews_summary2({\"watershed\":100,\"isBeta\":true,\"isShowDefaultSort\":true,\"data\":{\"correspond\":\"4.8\",\"correspondCount\":2259,\"correspondList\":[\"86.19\",\"10.05\",\"2.66\",\"0.40\",\"0.71\"],\"count\":{\"additional\":1,\"bad\":0,\"correspond\":0,\"good\":88,\"goodFull\":208,\"hascontent\":0,\"normal\":0,\"total\":88},\"impress\":[{\"attribute\":\"620-11\",\"count\":15,\"title\":\"质量不错\",\"value\":1},{\"attribute\":\"166-11\",\"count\":9,\"title\":\"外形不错\",\"value\":1},{\"attribute\":\"10120-11\",\"count\":8,\"title\":\"态度不错\",\"value\":1},{\"attribute\":\"666-11\",\"count\":8,\"title\":\"材质很好\",\"value\":1},{\"attribute\":\"266-11\",\"count\":6,\"title\":\"做工不错\",\"value\":1},{\"attribute\":\"520-11\",\"count\":5,\"title\":\"实惠\",\"value\":1},{\"attribute\":\"420-11\",\"count\":5,\"title\":\"物流快\",\"value\":1}],\"links\":null,\"refundTime\":0,\"spuRatting\":[]}})");
            //string html = Requests.GetText("http://item.taobao.com/item.htm?spm=a1z10.1.1003-536842892.1.3Hycud&id=15793507285");
            //MicroScopeDataParser.ParseMicroScopeData(html);
            //dynamic config = ConfigParser.ParserConfigToObject(html);
        }
    }
}
